home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Diamond Collection
/
The Diamond Collection (Software Vault)(Digital Impact).ISO
/
cdr22
/
mcalc199.zip
/
MCALC.HLP
< prev
next >
Wrap
Text File
|
1995-01-07
|
97KB
|
2,609 lines
{???}
Help on Help using on line help system. Topic : ???
This online help system is a small hypertext that can display help screens
about various topics. The help is always displayed on the first 24 lines
of the screen. The last line is a menu line :
Select help : (T)opics, (I)ndex, (C)ontents, (P)revious, (N)ext, (Q)uit
TOPICS prompts you to enter the next topics you search help for.
INDEX displays immediately the 'Index' help screen.
CONTENTS displays immediately the 'Table_of_contents' help screen.
PREVIOUS displays the previous help screen (if any).
NEXT displays the next help screen, (if any after a PREVIOUS
selection).
QUIT return from the help system to Mcalc.
When more help is available on a particular topic, this one is displayed
between brackets, like in {???}. Strike <TAB> to jump to next displayed topic.
Strike <SHIFT><TAB> to jum to previous topic. Strike <ENTER> to select topic
marked by the cursor.
Example : See topic {SUMMARY} to obtain an overview of MCalc possibilities.
Strike T to select TOPICS, then strike S U M M A R Y followed by <RETURN>
or strike <TAB>, then <RETURN>.
{CONTENTS}
Table of contents.
------------------
{Summary} Summary help screen for Mcalc.
{???} How to use the on-line help system?
{Commands} List of commands sorted by type.
{Keywords} List of all Mcalc keywords.
{Functions} List of functions sorted by type.
{Index} Index of all available topics.
{Procedure_Basic} Introduction to the procedure language.
{Utilities} List of Mcalc supplied utilities.
{Version} Version of Mcalc availables and release notes.
{Keywords}
List of all Mcalc keywords.
---------------------------
Next_page: {Keyword1}
Keyword C/F Eval Proc Description:
{abs} F X X absolute of a value
{acos} F X X arc cosine
{acosh} F X X hyperbolic arc cosine
{and} F X X bitwise and of to integer numbers
{asin} F X X arc sine
{asinh} F X X hyperbolic arc sine
{atan} F X X arc tangent
{atanh} F X X hyperbolic arc tangent
{atan_} F X X four quadrans arc tangent
{close} C X X close any opened input file or log file
{clear} C X X reset all variables to 0.0
{cls} C X X clear the current screen (in text mode)
{color} C X change the current pen color in graphical mode
{convert} C X X convert value between units
{cor} C X X compute the correlation between two series
{cos} F X X cosine
{cosh} F X X hyperbolic cosine
{dot} C X draw a dot in graphical mode
{Keyword1}
List of all Mcalc keywords.
---------------------------
Next_page: {Keyword2}, Previous_page: {Keywords}
Keyword C/F Eval Proc Description:
{edit} C X invoke the editor menu
{editm} C X invoke the macro editor/compiler driver
{end} C X terminate a procedure execution
{exp} F X X exponential of base 'e'
{exp2} F X X exponential of base 2
{exp10} F X X exponential of base 10
{fact} F X X factorial
{finput} C X read one value from a file
{finput_} C X read two numbers from a file
{float} C X X view or change floating point exceptions
{for} C X enter a 'for' loop
{format} C X X specify the numeric answer format
{frac} F X X fractional part of a real number
{from} S X X 'convert from to'
{gosub} C X call a subroutine
{goto} C X transfert procedure execution
{graph} C X enter graphical mode during procedure execution
{help} C X X invoke the online help system
{iconv} C X X inverse conversion
{Keyword2}
List of all Mcalc keywords.
---------------------------
Next_page: {Keyword3}, Previous_page: {Keyword1}
Keyword C/F Eval Proc Description:
{if} C X X conditionnal execution
{inormal} F X X inverse of gaussian distribution
{input} C X enter a value from the keyboard
{inputk} F X X read a keyboard key and return the code
{int} F X X integer part of a real number
{integral} C X romberg finite integration of a function
{interpol} C X X interpolation from a data serie using lagrange
{interpol_} C X X interpolation from a data serie using spline
{j0} F X X Bessel function
{j1} F X X Bessel function
{jn} F X X Bessel function
{last} F X return the last answer
{line} C X draw a line in graphical mode
{list} C X X list all allocated variables not null
{listk} C X list all user defined function keys
{listr} C X X list all points used from the last regression
{ln} F X X logarithm in base 'e'
{Keyword3}
List of all Mcalc keywords.
---------------------------
Next_page: {Keyword4}, Previous_page: {Keyword2}
Keyword C/F Eval Proc Description:
{load} C X X load a new procedure in the editor memory
{loadvar} C X X reload values from a dumpfile to the variable
{lock} C X X modify remote file status and content
{log} F X X logarithm in base 'e'
{log2} F X X logarithm in base 2
{log10} F X X logarithm in base 10
{macro} C X X execute or abort a keyboard macro
{max} F X X maximum value of a data serie
{mean} F X X average value of a data serie
{min} F X X minimum value of a data serie
{modulo} F X X modulo of a value by another one
{next} S X 'for to step ... next'
{normal} F X X gaussian distribution
{not} F X X bitwise inversion of integer number
{or} F X X bitwise or of integer numbers
{pi} F X X returns the value or 'pi'
{pixel} C X set/reset a pixel in graphical mode
{plot} C X plot a function
{plotr} C X plot the last regression result
{print} C X displays expressions or strings
{Keyword4}
List of all Mcalc keywords.
---------------------------
Next_page: {Keyword5}, Previous_page: {Keyword3}
Keyword C/F Eval Proc Description:
{pwr} F X X raise a value at a power
{quit} C X X finish an Mcalc session
{rcl} F X X recall a value stored in a variable
{rconv} C X X repeat a conversion
{read} C X X open an ascii file in input mode
{read_} C X X open & read data from a file to variable
{reg} C X (X) execute regression analysis
{remote} C X X request remote file status
{return} C X return from a subroutine
{rnd} F X X random number generator
{run} C X X run a procedure
{savevar} C X X store variables contents to a dumpfile
{scale} C X X modify graphic axis scale type
{setup} C X modify Mcalc default parameters
{shell} C X X call a dos shell session
{sigma} F X X spread value of a data serie
{sin} F X X sine
{sinh} F X X hyperbolic sine
{Keyword5}
List of all Mcalc keywords.
---------------------------
Next_page: {Keyword6}, Previous_page: {Keyword4}
Keyword C/F Eval Proc Description:
{solve} C X equation solver (find roots)
{solve_} C X equation solver (find extremums)
{sqr} F X X square root
{sqrt} F X X square root
{step} S X 'for to step ... next'
{sto} F X X store a value into a variable
{table} C X generate a table of function's values
{tan} F X X tangent
{tanh} F X X hyperbolic tangent
{task} C X X invokes a Mcalc user task
{then} S X 'if ... then'
{to} S X 'for to step next' 'convert from to'
{twopi} F X X returns the value of '2 * pi'
{write} C X X open a log file
{Keyword6}
List of all Mcalc keywords.
---------------------------
Previous_page: {Keyword5}
Keyword C/F Eval Proc Description:
{y0} F X X Bessel function
{y1} F X X Bessel function
{yn} F X X Bessel function
{xor} F X X bitwise xor of integer numbers
{Commands}
List of commands sorted by subject.
-----------------------------------
Mcalc commands fall into the following categories:
Files I/O: {read} {write} {finput} {finput_} {print} {close}
Numerical analysis: {plot} {table} {solve} {solve_} {interpol} {interpol_}
{integral}
Memory and procedures: {load} {loadvar} {savevar} {run} {edit} {NOTEPAD}
Keyboard and macros: {editm} {macro} {MAC} {MCMAC} {NOTEPAD} {MCKEY}
{listk}
Units conversion: {convert} {rconv} {iconv} {MAKEUNIT}
Statistics: {read_} {reg} {cor} {listr} {plotr}
Miscellaneous: {format} {setup} {help} {list} {shell} {quit} {task}
{remote} {lock} {float}
{VERSION}
This is Mcalc Version 2.0.
Copyright (C) 1994 by D. Gosseau.
History of the various Mcalc versions from 1.0:
Version 1.1 :
a) 'format' use a string formatter instead of taking two decimal numbers,
allowing more flexibility. For more details: {format}
b) 'for next' loop now support floating value and require the 'step'
argument. Loops may be integer of floating, increment or decrement. For
more details: {for}
c) The new command 'convert' is added to perform unit conversion. Please,
look at {convert} and {makeunit} for more details.
More: {Version1}
{Version1}
Version 1.2 :
Starting with version 1.2, Mcalc supports now some functions with a variable
number of arguments. If no argument is necessary, no parenthesis are necessary.
This new features implies the following changes:
1) The indirect adressing is no more using the 'i' variable. The syntax
of the STO function has changed. Please, look at {STO} for the
details.
2) The following functions do no more use the 'p' variables:
pwr, atan_, jn, yn, and , or, and xor.
3) The Pi function no more request a dummy argument.
4) The following functions are added:
'twopi' returns twice the value of 'pi'.
'last' returns the value of the last calculation. The variable 'l' is
no more affected.
More: {Version2}
{Version2}
Version 1.3 :
From this version, the variable tables is allocated at runtime. The number of
total variables (direct + indirect access) can be up to 8000. The table size is
defined in Setup. The 'setup' command accepts a new optional argument.
Version 1.41 :
From this version, the basic statistical functions and regression are covered
using a totally different concept. With respect to previous versions, the
following commands and functions are changed:
1) The commands 'clsum', 'sum' and 'sum_' are removed. The function
'correl' is also suppressed.
2) The following commands are added:
'reg' performs a multi-model regression analysis.
'plotr' plots the data cloud and function of the last regression.
'listr' lists the data points of the last regression.
'cor' performs a new correlation function with graphical result.
3) The following functions are modified: 'mean' and 'sigma'.
Please, refer at {Statistics} for detailed explanations.
4) Two new commands are added to store or retreive memory contents
to/from disk file: 'savevar' and 'loadvar'.
More: {Version3}
{Version3}
Version 1.6 :
1) From this version, the user functions keys are user configurables.
The definitions are stored into 'mcalc.key' file. This file is
created from an ASCII description file via the 'mckey.exe' utility.
Please, refer to {listk} for more details.
2) A new {notation} is available: #v. Please, refer at this topic for
more details.
3) Two new functions are added: normal and inormal. Please, refer to
{Statistics} for more details.
4) Four new commands are added: read_, integral, interpol and interpol_.
Please, look at each of these topics for details.
5) The online help system has been reordered. A compleet list of all
available keywords is supplied.
Version 1.7 :
1) This version supports keyboard macros. Please, refer at {Macro} for
details. The following commands are added: 'editm', 'macro'.
2) The 'dot' command is added.
Version 1.8 :
1) The 'clear' command has been added.
2) Some minor bugs have been corrected.
3) The 'assistant' interface has been added for later improvements.
More: {Version4}
{Version4}
Version 1.92 :
1) The functions 'min' and 'max' have been added. Please, see
{Functions} for more details.
2) The {task} command has been added.
3) Some minors bugs have been corrected.
4) Some extra commands have been implemented for internal purpose in the
keyboard macro interface driver and compiler.
Version 1.995 :
1) The {scale} command has been added.
2) The remote falicities for Windows 386 mode have been added. Please,
refer to {remote} and {lock} for details.
3) The {modulo} function has been added.
4) The on-line system now only uses the mouse if necessary.
5) Setup M now defines the path for various kind of files.
6) The command line switchs /P and /R are added.
7) The floating point exception handler has been enhanced. The {float}
command has been added.
{INDEX}
Index of available help topics.
-------------------------------
{Area_pointer} {Arithmetic} {Bessel} {Binary} {Functions}
{Help} {Internal_editor} {Keywords} {last} {Macro}
{MAC} {MCMAC} {MAKEUNIT}
{MCKEY} {Notation} {Operators} {Power and Log}
{Procedure_Basic} {setup} {Statistics} {Summary} {Trigonometric}
{Variables} {Version}
{SUMMARY}
Summary of online available help.
---------------------------------
{Keywords} : list of all recognized keywords in alphabetical order.
{Commands} : list of commands sorted by type.
{Functions} : list of functions sorted by type.
{???} How to obtain help on the help system.
{Notation} : #x #h = hexa, #o = octal, #b = binary , #a = ascii, #v =
variable index.
{Operators} : + - * / ^ ()
{Procedure_Basic} : list of all commands typically used into a procedure.
{Variables} : a --> z and indirect access.
Assignment : variable = expression (ex: i=3)
{float} : Mcalc handler of floating point exceptions.
{Edit}
edit
----
This command is used to enter the editor mode. When given, the following menu
is displayed :
Command mode : (L)oad, (S)ave, (E)dit, (R)un, (N)ew, (D)ir, (Q)uit.
Load & Save are used to Load a Master Calc Procedure into memory (or save it
to a file).
Edit is used to execute the {Internal_editor}.
Run is used to execute the procedure, starting from the first line.
New is used to erase the editor area.
Dir is used to obtain a directory of all available procedures.
Quit return from editor mode to evaluation mode.
A procedure length is limited to 50 lines, but only the twenty first can be
edited and displayed using the internal editor.
Related topics: {Load}, {Run}
{Internal_editor}
Internal editor.
----------------
The internal editor is suitable for fast edition of simple procedure. It can
only process a 20 lines maximum text file. (MCalc supports a maximum of 50
lines of program. In such case, use an external editor). This editor is very
limited as no delete/insert function is supplied at the character level. The
editor works only in overwrite mode. The only supported keys are :
Up Cursor motion.
Down "
Left "
Right "
End insert an empty line at the cursor position
Ctrl Y delete the line at the cursor position
ESC exit the internal editor mode.
Remark : Version 2.0 of MCalc will be supplied with a more sophisticated
editor.
{clear}
Clear
-----
This command is used to reset all variables to 0.0. It affect both direct and
indirect variables. The 'last' function returns the highest valid indirect
index.
{Convert}
Convert
-------
This command is used to convert a value from one unit to another one. Both
units are checked to be of the same dimension.
Syntax : Convert expression from "unit1" to "unit2"
Convert expression from "?"
expression any expression resulting in a numeric value to be
converted.
unit1 a quotted string of the original unit.
unit2 a quotted string of the destination unit.
If the second syntax is used, Mcalc prompt you for both units. It displays
first the units available into its table. If the first syntax is used, both
units may contain Prefix_Declaration.
In evaluation mode, the answer of convert, rconv and iconv is stored into the
variable 'l' as last result.
More : {convert1}
Related topics: {rconv}, {iconv}, {makeunit}
{Convert1}
A Prefix_Declaration, is a prefix that preceeds the unit string and that
declares the unit must be interpreted as a multiple of submultiple.
The following prefixes are recognized by Mcalc:
E exa 18 d deci -1
P peta 15 c centi -2
T tera 12 m milli -3
G giga 9 µ micro -6
M mega 6 n nano -9
k,K kilo 3 p pico -12
h,H hecto 2 f femto -15
D deca 1 a atto -18
The prefix is separated from the unit by a underscore character. For example,
to convert 1 hectare into acre, give the following command:
convert 1 from "h_a" to "acre"
More: {convert2}
{convert2}
The unit conversion algorithm used by Mcalc, performs dimension checking
between units before conversion. You cannot convert units having unequal
dimensions. For example, you can convert "Pa" to "mmHg" because both are
pressions, but you cannot convert "ohm" into "S" (Siemens), because self if
they are related concepts, they are not the same physical dimension.
Caution: When converting temperature, Mcalc does not keep track of offset
between units. For example, conversion between ΦC and ΦF will be
exact to convert the amount of ΦC into ΦF, but ignore the different
origins of the scales.
To check dimension, each unit is stored into a table with its basic dimensions
in the international system. This recognizes 7 basic units: m, kg, s, A, ΦK, cd
and mol. We have added a eigth unit called cur for currency. This is intended
to enable you to perform also conversion between various currencies. Because
these units are not fixed one, you have to regulary update the unit table used
by Mcalc. To do that, you can use the supplied utility {MakeUnit}.
{rconv}
Rconv
-----
This command is used in relation with {Convert} and {Iconv}.
If you have to regulary perform the same conversion, Rconv (as Re-Convert) is
used as a shortcut to repeat a conversion process without having the redefine
the same units.
Syntax : rconv expression
Rconv uses the last units specified with Convert.
{iconv}
Iconv
-----
This command is used in relation with {Convert} and {Rconv}.
If you have to regulary perform the same conversion, Iconv (as Inverse-Convert)
is used as a shortcut to repeat a conversion process without having the
redefine the same units.
Syntax : iconv expression
Iconv uses the last units specified with Convert but perform an inverse
conversion.
{MakeUnit}
MakeUnit
--------
Makeunit is a utility supplied with the registered version of Mcalc and used to
add, delete or modify units from the table. Mcalc and MakeUnit have space for
100 units into one file. Be carefull never to modify the original data file
delivered with Mcalc. Works always on a copy!
Be consitent in the description of dimension of units. The values are the power
of these units. For example, the "Pa" pressure unit has the dimension:
1 Kg/m*s^2
This is defined as: Kg +1, m -1, s -2.
{Plot}
Plot
----
This command is used to plot the evolution of a procedure describing a function
or an equation. The procedure must first be loaded in the editor screen.
It must describe a function or a program that take one value as input into one
variable and return an answer into another variable.
Syntax : Plot input_var , output_var, from , to , nb_steps
input_var the procedure input variable name
output_var the procedure output variable name
from the begin of the input_var range
to the end of the input_var range
nb_steps the number of points to compute [max : 8192]
When the graphic is displayed, you are in interactive mode.
More : {Plot1}, Related_command: {Table}, {Plotr} and {Scale}
{Plot1}
Example : To plot the 'sin(x)/x' function, edit the following procedure :
if x=0 then goto 10
y = sin(x)/x
end
10 y=1
end
Now, in evaluation mode, give the 'setup' command and taek care the
trigonometric switch is in 'Radian'. Give the following command:
plot x,y,-40,40,500
This will plot the procedure sin(x)/x between -40 and +40 using 500 points.
The variable x is assumed the input variable of the procedure and y the output.
Example : To plot the polynom 'ax2+bx+c' edit the following line :
z = a*x^2+b*x+c
Now, in evaluation mode, give for example :
a=1
b=0
c=-4
Now, plot is with : plot x,z,-3,3,100
{Table}
Table
-----
The table command works exactly like the {Plot} command. Instead of plotting
the procedure, a table of the X,Y kind is displayed.
Syntax : Table input_var , output_var, from , to , nb_steps
input_var the procedure input variable name
output_var the procedure output variable name
from the begin of the input_var range
to the end of the input_var range
nb_steps the number of points to compute [max : 8192]
Please, refer to {Plot} for how to write the procedure.
{List}
List
----
This command displays every variables 'a' to 'z' that has been assigned a non
zero value, as well as all others variables referenced via indirect adressing.
Related command: {Listr}
{Shell}
Shell
-----
This command execute a dos shell command.com routine. You are at the dos prompt
but your Mcalc session is not finished. By giving the Dos 'Exit' command, you
come back to Mcalc and continue where you were.
Caution: Take care to stay in the original subdirectory when you come back to
Mcalc !!!
{Format}
Format
------
This command take one double quotted string and define the standard output
format.
Syntax : Format "string"
where "string" represents the traditionnal ANSI C printf format
string descriptor of the general form:
% prefix width .precision l type
prefix - = left justify, + = preceed with sign, blank = preceed
with blank
width the minimum number of digits to display
precision the number of decimal digits to display
type f = fixed float, e = scientific notation,
g = f or e (whichever is the shorter).
Example: format "%-15.3lf"
The default format is "%17.15lg".
{Variables}
Variables.
----------
Mcalc use up to 8000 variables.
The 26 first have direct access and are called 'a' to 'z'.
All variables have also index 0 to 7999. They can be accessed indirectly.
Direct access :
Assignment : variable = expression
a = sin(x) / x + x^3 - 12.5
Usage : within an expression. If the first argument of the line, must be
preceded by + or -
+a+12.5 is equivalent to 12.5+a
Indirect access :
Assignment: STO(value,index)
Usage: RCL(index)
For more info refer to {STO} and {RCL}
{STO}
Indirect memory assignment.
---------------------------
The STO function is used to enable indirect memory assignment.
Syntax : STO(value,index)
Returned value : the index
Example : To assign the value 12 to the variable 'b' that has
index value 1, do the following :
sto(12,1)
Equivalence : b=12
Related function : {RCL}
{RCL}
Indirect memory usage.
----------------------
The RCL function is used to retreive a variable content via indirect access.
Syntax : RCL(index)
Returned value : the value stored in the indexed variable.
Example : To retreive indirectly the content of variable 'b'
that has the index value 1, do the following :
rcl(1)
Equivalence : +b
Related function : {STO}
{Operators}
Operators.
----------
Mcalc recognizes the following operators, sorted from highest to lowest
priority :
()
^ Integer exponent (For real exponant, use the 'pwr' function.)
* and / Multiplication and Division
+ and - Addition and substraction
{Functions}
List of functions sorted by subject.
------------------------------------
Mcalc functions fall into the following categories:
{Power and Log} pwr sqr sqrt log ln log10 log2 exp exp10 exp2
{Trigonometric} sin cos tan asin acos atan atan_
sinh cosh tanh asinh acosh atanh
pi twopi
{Arithmetic} abs int frac rnd fact modulo
{Bessel} j0 j1 jn y0 y1 yn
{Binary} not and or xor
{Statistics} mean min max sigma cor normal inormal
{last} returns the value of the latest answer
Please, refer at the particular topic for details on each function
argument list, usage, description and syntax.
{Power and Log}
Power and Logarithm.
--------------------
Syntax : Function(value)
Returned value : Example :
pwr use two arguments: arg1 at power of arg2 pwr(2,4) --> 16
sqr square root of value
sqrt
log natural logarithm of value
ln
log10 logarithm in base 10 or 2 of value
log2
exp respectively e, 10 or 2 at the power of value
exp10
exp2
{Trigonometric}
Trigonometric functions.
------------------------
Syntax : Function(value)
Returned value :
sin sinh the sine of value
cos cosh the cosine of value
tan tanh the tangent of value
sinc the cardinal sine of value
asin asinh the inverse sine of value
acos acosh the inverse cosine of value
atan atanh the inverse tangent of value (Please, refer also {atan_}
pi,twopi the value of 'pi' or 2 pi. These two functions don't take any
argument.
The 'h' version means the hyperbolic function.
Depending of the {Setup}, the arc is interpreted as degree or radian, excepted
for the hyperbolic version.
{atan_}
The trigonometric atan_ function.
---------------------------------
The trigonometric 'atan_' function requires two arguments.
Syntax : atan_(value_x , value_y)
atan_ use the sign of both arguments to determine the quadrant of the
returned arc. Depending of the {Setup}, the arc is interpreted as
degree or radian.
{Bessel}
Bessel's functions.
-------------------
The following Bessel functions are available:
j0 j1 jn y0 y1 yn
Syntax : Function(value)
Remark: The 'jn' and 'yn' functions require two arguments, the
order n is the second arguments.
Example: The following expressions are equivalent:
j0(10) and jn(10,0)
{Arithmetic}
Arithmetic functions.
---------------------
Syntax : Function(value)
Returned value :
abs the absolute value of 'value'
int the integer part of value
frac the fractional part of value
equals : value - int(value)
rnd a random number.
if value = 0 : uniform distribution between 0 and 1
if value > 0 : gaussian distribution with mean=0, sigma=1
if value < 0 : a new seed is asked for.
fact the factorial of value
modulo value1 modulo value2 (both values are considered as long integer
numbers.)
{Binary}
Binary functions.
-----------------
The binary function handles their argument as if they are a unsigned long
integers (32 bits unsigned integer).
Syntax : not(value)
and(value1,value2)
or(value1,value2)
xor(value1,value2)
Returned value
not bitwise 'not' of value
and bitwise value1 and value2
or bitwise value1 or value2
xor bitwise value1 exclusive or value2
Value can be entered as decimal, octal, hexadecimal and binary.
Please, refer to {Notation} for more details.
{Statistics}
Statistical functions and commands.
-----------------------------------
Mcalc supplies a set of commands and functions to perform single statistics and
multiple models regression analysis. The Procedure_Basic commands 'finput' and
'finput_' are used to enter the data points into the indirect access variables
table. The 'mean' and 'sigma' functions returns the average (or mean value) and
the RMS (or sigma value) from a serie of data points. The commands 'reg',
'plotr', 'listr' and 'cor' are used to perform, plot regression from a serie of
data points. The statistical functions and commands are based on the concept of
'{Area_Pointer}'. Please refer to this topic for more details.
Commands:
{read_} read a structured data file and store it in memory
{reg} performs a regression analysis on a data serie.
{plotr} plots a data serie or the regression results.
{listr} list the data serie of a regression
{cor} calculate and display a correlation function of two data series.
Functions: Returned value:
{mean} the mean of a data serie.
{min} the minimum of a data serie.
{max} the maximum of a data serie.
{sigma} the spread of a data serie.
{normal} the probability of a random variable in a normal distribution.
{Notation}
Notation for constant.
----------------------
Normally, any constant is supposed to be a decimal value. It is any number
composed of the following characters : '.+-1234567890' Also scientific notation
is supported. The following numbers are valid: 1234 0.5123 + 1 2 3 4
1.435e-3 -12.5 -12.45d5
In scientific notation, the character 'd','D','e' and 'E' are identical.
A number may not begin with a decimal dot: 0.5 is ok, .5 is not!
Unsigned long integer numbers (32 bits integer numbers) are supported when
introduced by the '#' character. The following notation is valid:
#hvalue #Hvalue #xvalue #Xvalue = hexadecimal numbers
#ovalue #Ovalue = octal numbers
#bvalue = binary numbers
#achar = ascii character code
#avariable = the indirect access index value of that variable (a-z)
The following are equivalent : #aG = #h47 = #o107 = #b1000111 = 71
More details about customazing the display : {Setup}
{Procedure_Basic}
Procedure Basic
---------------
Procedure_Basic is a subset of the BASIC language that you use within Mcalc to
write procedures. A procedure is a small entity that play the same role as an
equation or a small program. Procedure_Basic includes the following command
set, that may only be used inside a procedure.
{input}
{finput} finput_
{read} {close}
{print}
{if}___then
{for}___next___step
{goto}
{gosub} return
{graph} {color} {scale}
{pixel} {dot} {line}
{write}
{end}
Related_topic: {Keywords}, {Functions}, {Commands}
{end}
end
---
This keyword is used to finish the execution of a procedure. When encountered,
the execution is returned to the calling process. Usually the evaluation parser
or a high level command as {plot} or {solve}.
{input}
input
-----
The 'input' keyword is used in {Procedure_Basic} to enter a value to a variable
when running a procedure.
Syntaxe : input "message" , variable_name
input variable_name
When encoutered, the procedure execution is suspended and "message"
is displayed. (If the 2nd syntaxe is used, a default prompt is
displayed.) You have to enter a decimal numeric value.
The value is then assigned to the variable.
Any valid variable_name is accepted. Please, refer to {Variables} for
details.
{finput}
finput & finput_
----------------
These keywords are used in {Procedure_Basic} to enter a value to a variable
when running a procedure. The value is entered from the currently opened file.
Syntaxe : finput variable_name
finput_ variable_name_1 , variable_name_2
When encoutered, the procedure execution is suspended and "message"
is displayed. The value is obtained from the currently opened file
and assigned to the variable. The 2nd syntaxe is used to read two
values from the same line.
Any valid variable_name is accepted.
Other topics: {input}, {read}, {close}
{inputk}
inputk
------
This function is used to read a key from the keyboard and to return its ascii
or scan code.
Syntaxe : inputk(flag)
When evaluated, this function read a keystroke and return a floating
value of the key that was striked. The returned code is of the form:
ascii_code,scan_code.
The value before the decimal dot means the ascii code.
The value after the decimal dot, multiplied by 1000 means the scan
code. The scan code is only available if there is no ascii code.
flag : this flag determine where the key is obtained. If
positive or null, the key is extracted directly from
the PC keyboard buffer. (Any key supplied by a
currently running macro is ignored). If negative, the
key is extracted from Mcalc internal buffer. The PC
keyboard or the currently running macro is extracted.
{read}
read
----
This keyword is used in Procedure_Basic, or as a command to open an ascii data
file that contains numeric values.
Syntaxe : read "filename.type"
The specified file is searched for and opened for input. It may
contain two kind of syntaxe lines:
value1
value2
value3
....
value1,value2
value3,value4
....
Use 'finput' to read the first syntaxe, and 'finput_' for the 2nd.
Other topics: {close}, {finput}
{close}
close
-----
This keyword is used in Procedure_Basic or as a command to close any opened
file, with the {read} or {write} commands.
Syntaxe : close
{print}
print
-----
This keyword is used as in a Procedure_Basic or as a command to send
expressions to the screen (and loggin file).
Syntaxe : print item [separator] [item] [separator]
item can be a valid expression or a "quoted_string"
separator can be ";" or ",". If a comma is used (,) a tabulation
is send; if a semicolon (;) is used, only one space
character will separate from the next item.
If no separator is used at the end of the line, a <Carriage Return>
<Line Feed> is send.
Other topics: {write} {close} {format}
{if}
if ... then
-----------
This Procedure_Basic keyword is used to switch procedure execution according to
a test result.
Syntaxe : if expression test expression then command
expression is any valid expression (constant and/or variable).
test is one of the following characters : < > =
command any procedure_basic command
Example : if x > (2*pi(1)) then goto 4
{for}
for ... to ... step ... next
----------------------------
The 'for' keyword is used in procedure_basic to enter a loop.
Syntaxe : for variable = expr1 to expr2 step expr3
....
next
Caution : if (expr3 >0) expr1 must be less than expr2,
else expr1 must be bigger than expr2.
Each time a next statement is encountered, variable is
incremented by expr3.(If expr3 is negative, variable
is decremented.)
The loop is at least executed once self if expression2
is directly obtained.
{goto}
goto
----
This procedure_basic command is used to transfert the execution to a given
label.
Syntaxe : goto label
label is any integer number found exactly at the beginning
of a procedure line.
Example : the following procedure is used to program manually a
cardinal sine.
if x=0 then goto 10
y = sin(x)/x
goto 20
10 y=1
20 end
{gosub}
gosub .... return
-----------------
This Procedure_Basic keyword is used to call a subroutine. A subroutine is a
list of instructions terminated by a return.
Syntaxe : gosub label
label instructions
return
Example : another implementation of a cardinal sine function:
gosub 100
end
100 y=1
if x=0 then return
y=sin(x)/x
return
{graph}
graph
-----
This Procedure Basic keyword is used to enter into graphical mode. It commutes
the screen to graphical mode, and plot two axis according to the scale
information that follows. After that, execution is returned to the current
procedure. All following procedure body is assumed to compute a graphic and to
output it via the {pixel} and {line} commands. No more input or print command
may be encountered during the rest of this procedure.
Syntax : graph xmin , ymin , xmax , ymax
xmin ymin are expressions representing the lower left corner
scale of the graphic
xmax ymax are expressions representing the upper right corner
scale of the graphic
Example : {graph1}
Related keywords: {pixel} , {line}, {dot}, {color} and {scale}
{graph1}
Example of procedure using graph, pixel and line.
-------------------------------------------------
The following procedure illustrate the use of the {graph}, {pixel} and {line}
commands to plot an hyperbolic tangent:
graph -3,-1.2,3,1.2
d = 6 / 201
x=-3
for i=0 to 200
y = (exp(x)-exp(-x)) / (exp(x)+exp(-x))
if i=0 then pixel x,y,-1
line x,y
x = x+d
next
{pixel}
pixel
-----
This Procedure Basic command is used only into a procedure to switch on or off
a pixel on the screen. It is only valid into a running procedure, after the
'graph' command has been executed.
Syntax : pixel x , y , flag
x and y are the coordinates of the pixel to modify.
flag if positive the pixel is switched on
if negative the pixel is switched off
Example: {graph1}, Related keywords: {graph}, {line}, {dot}, {color}
{dot}
dot
---
This Procedure Basic command is used only into a procedure to draw a small boxe
on the screen. It is only valid into a running procedure, after the 'graph'
command has been executed.
Syntax : dot x , y
x and y are the coordinates of the center of the boxe to draw.
Related keywords: {graph}, {line}, {pixel}, {color}
{line}
line
----
This Procedure Basic command is used only into a procedure to draw a line on
the screen. It is only valid into a running procedure, after the 'graph'
command has been executed.
Syntax : line x , y
x and y are the coordinates of the point that must be joined
by the line. The origin of the line segment is the
coordinates of the last line or pixel command. If none
of these command have been executed before, the origin
is the top of the y axis.
Example: {graph1}, Related keywords: {graph}, {pixel}, {dot}, {color}
{color}
color
-----
This Procedure Basic command is used only into a procedure to change the
current pen color for subsequent 'dot','pixel' or 'line' instruction. It is
only valid into a running procedure, after the 'graph' command has been
executed.
Syntax : color index
index an integer value in the range 0-15.
By default, in color mode, the following colors are defined (but may be
redefined using 'setup') :
0=blue 1=yellow 2=green 3=red
4=cyan 5=magenta 6-15=white
By default, in B&W mode, the following colors are defined:
0=black 1-15=white
Related topics: {graph}, {line}, {dot}, {pixel}
{Solve}
solve.
------
The Solve command is used to find one or more real root(s) of the current
procedure. It is advised first to use the {Plot} or {Table} command to get an
idea about the procedure behaviour, before using the Solve command.
The procedure must first be loaded in the editor screen. t must describe a
function or a program that take one value as input into one variable and return
an answer into another variable
Syntax : solve input_var , output_var , root_approx
input_var the procedure input variable name
output_var the procedure output variable name
root_approx is an approximation to start searching a root
Solve use a Newton algorithm to find a root. The accuracy and number maximum of
itterations are defined with the {Setup} command.
Example:{solve1}, Related_command: {solve_}
{Solve1}
Example : to find the root of the equation : x^2=4, you rewrite the
equation as a procedure of the form:
Output_var = functionLeft(Input_var) - FunctionRightInput_var)
in this example : y = x^2-4
Now, you give : solve y,x,0
Mcalc supplie one root : 2.0000 and eval = value of the
procedure at the root. You are now asked if you want to find
another root. Answer yes and give -1 as first approximation.
{Solve_}
solve_
------
The solve_ command works exactly like the solve command. But instead of looking
for a root of the evaluation procedure, solve_ looks at the root of the first
derivative of the procedure. The solve_ function returns the extremum of the
given procedure.
Please, refer to the {solve} topic for more details.
{Setup}
setup
-----
The 'setup' command enter a dialog where various customizing parameters may be
modified. They are grouped in categories: General purposes, Plotter and Solver.
To modify only one categorie give the 'setup' command followed by g,p,s or m.
General purposes flags:
Trigonometric mode : (R)adian or (D)egree
Programmer binary output
If set, all answers in evaluation mode are systematically displayed as
binary, ascii, hexadecimal and octal as well as normal floating number.
Help automatically supplied:
If set, the general help mode is entered after every error message.
Procedure break enabled
If set, a procedure will be aborted if any keystroke occurs when
unexpected.
Procedure trace mode enabled
If set, the debug mode is active. The procedure is executed in single step
mode and every modified variable is displayed.
Display status in prompt
if set, the extended prompt is used instead of Mcalc.
Next_page: {setup1}
{setup1}
Display prompt in color
If set, the Mcalc prompt, the logo and the user entries are displayed in
color.
Max Nb of variable to allocate.
Max Nb of variable to list.
This specifies the size of the indirect access variable table.
The 2nd value specifies the number of variables displayed with the 'List'
command.
PLOT command flags: These are used by the 'Plot' command.
Screen mode
Specify the screen mode in graphical mode : use 6=CGA, 16=EGA, 18=VGA, and
-3 = highest possible resolution.
Screen lines
Nb of text lines in graphical mode : 25, 43, 50 , 60, or -1 = max
Use fonts if available ?
Use a graphical font is present and defined via 'fontdir' and 'fontface'.
Please refer to the user manual for details.
Use mouse if available ?
Use a mouse if any present and this flag set.
Graphical screen : Color , BW ?
Define if graphics will be in Black and White or in colors.
Next_page: {setup2}, Previous_page: {setup}
{setup2}
Edit color's palette ?
If 'Y', the color palette may be customized. See {setup3} for details.
X(Y) Axis format.
This descriptor use the C ANSI printf format syntax to describe how the
axis will be labeled. Please, refer to the user manual for details.
SOLVE command flags: These are used by the 'Solve' command.
Max iterations ?
The maximum number of iterations performed before Solve returns when it
cannot find a root with the requested accuracy.
Solve tolerance.
The accuraty on an obtained root.
Solve delta.
The relative value of the dependant estimation to calculate the
derivative.
Solve abs minimum seed.
The absolute value of the minimum seed to be used. The solver algorithm
does not support a null value as initial seed. It this occurs, it is
replaced by this parameter.
Interpolation polynomial order.
Order used for interpolation, using the 'interpol' command.
Next_page: {setup3}, Previous_page: {setup1}
{setup3}
If you have selected 'Graphical screen in color' and 'Edit color's palette
Yes', Mcalc finishs the setup session with a graphical screen showing a sine
wave, a cosine wave and a dumped cosine wave. By selecting option 'Ext', you
can modify the current color settings. You have to select first an index.
For each index, you can adjust the amount of intensities for the three basic
colors Red, Blue and Green. Then using + and -, you respectively increase or
decrease the color intensity. The current intensities for all three basic
colors is displayed as an hexadecimal number between 0 and 3f.
The following index match the following parts of the displayed graphic:
0 background
1 axis and legends
2 sine wave
3 cosine wave
4 dumped cosine wave
The index 5 to 15 are not displayed, but may be customized too !!!
Previous_page: {setup2}
{Quit}
quit
----
This command is used to quit Master Calculator.
{Write}
write
-----
This keyword is used in Procedure_Basic or as a command to open a result login
file. When such a file is opened, every result in evaluation mode or as a
'print' command is send also to that file. The file is opened in 'append' mode.
This means that it is never overwritten if already exist.
Syntax : write "filename.type"
write "prn"
If the 2nd syntaxe is used, the loggin report is redirected to the lineprinter.
The loggin mode is active as long as another 'write' command is encountered or
the {close} command is given.
{cls}
cls
---
This command is used to clear the current screen. You can use it in evaluation
mode as in a running procedure.
Caution : 'cls' may not be used in graphical mode. Uncontrolled effects could
happen.
{load}
load
----
This command is used to load a procedure in the editor memory, ready for use
with the plot and solve familly of commands, without using the edit interactive
menu.
Syntax : load "file_name"
file_name is the name of the procedure to load. The file
extension .mcp is automatically appended.
Related topics: {Edit}, {Run}, {Plot}, {Solve}
{run}
run
---
This command is used to load a procedure in the editor memory, and start its
execution directly (1st syntax). It can be used in a procedure to overlay
another one. It can also be used to start the execution of a procedure already
loaded via the load or the edit commands ( 2nd syntax).
Syntax : run "file_name"
run label
file_name is the name of the procedure to load and run. The file
extension .mcp is automatically appended.
label is a numeric line label of the entry point in the
already loaded procedure to run.
Related topics: {Edit}, {Load}, {Plot}, {Solve}
{Area_pointer}
Area Pointer
------------
For statistical functions and regression analysis, it is necessary to specify
the current adress of a table of numbers where the data points are stored. This
is done in Mcalc via the concept of 'Area Pointer'.
An area pointer is a block of successive contiguous memories (direct or
indirect access) whose contents give the adress of other indirect access
memories. An area pointer is a succession of 5 values:
Area_X is the adress of the first memory where the x series of data
points are stored.
Area_Y is the adress of the first memory where the y series of data
points are stored.
Area_Z is the adress of the first memory where the regression
calculated y series of data points are stored. It is also used
to define where the 'cor' command can store the resulting table.
Area_R is the adress of the first memory where the series of regression
results (the coeficient table) of data points is stored.
Area_Size is the size of Area_X, Area_Y and Area_Z. In other words, it is
the number of points included into the statistic series of data.
More: {Area_Pointer1}
{Area_pointer1}
An area pointer is defined by its adress. This is the indirect adress of the
first memory. (In other words, the adress of the memory where Area_X pointer is
stored).
Example: Suppose we want to perform a linear regression analysis. The five
points are couple of values (X1,Y1) , (X2,Y2) ... (X5,Y5). Let
suppose the number have been entered into the memories:
X1 to X5 in memories k,l,m,n,o
Y1 to Y5 in memories p,q,r,s,t
The calculated regression coef. in u and v.
The calculated y values from memory w.
Let store the pointers into memories b,c,d,e,f.
b=adress of memory k = #ak-#aa
c=adress of memory p = #ap-#aa
d=adress of memory w = #aw-#aa
e=adress of memory u = #au-#aa
f=5 (There are 5 data points in each series).
The area pointer beginning at memory b has the adress of b or #ab-#aa.
As you can see, using up to 8000 indirect variables, you are not limited into
your regression series sizes!
{reg}
reg
---
This command is used to perform a regression analysis on a series of data
points previously stored in memory. You can use this command in evaluation and
in program mode, as long as you don't use model 4. You can only use this
command in evaluation mode if you select model 4.
Syntax : reg Area_Pointer,0,Degre
reg Area_pointer,Model
reg Area_pointer,4,Nb_of_terms,Variable
The first syntax is used for a linear or polynomial regression. In this case
'Degre' is the order of the polynome. Specifying order as 1 means a linear
regression. In this case, the displayed and returned coeficients are a table of
values of the polynome starting with the constant term and followed by
increasing power of the independant variables.
The second syntax is used for non linear regression models:
Model 1 y = a + b * ln(x)
Model 2 y = a * exp(b * x)
Model 3 y = a * x ^ b
The displayed and returned coeficients are a and b.
Next_page: {reg1}, Related_topics: {Area_Pointer}, {Plotr}, {Listr}
{reg1}
The third syntax is used for the customized user defined model. This is the
most general least square regression model, as you define it yourself as a
procedure. It is also the slowest model. This least square method approximates
over the entire data interval with an expression of the form:
f(x) = c0*f0(x) + c1*f1(x) + .... + ck*fk(x)
In such model, there are k+1 terms. The functions f0(x), f1(x) ... fk(x) are
defined by the user as a procedure. The 'reg' command returns a table with the
coeficients c0, c1, ..., ck.
Using model 4, you have to load a function procedure basic and specify the
number of terms and the independant variable. When the procedure is called, the
variable that you specify contains the 'x' value of the above expression. Your
procedure must write the successive values f0(x), f1(x) ... fk(x) into a block
of indirect access variable. The variable 'i' points to the beginning of this
block.
Previous_page: {reg}, Next_page: {reg2}
{reg2}
Example: To write your self a customized regression for a parabole fitting of
the form:
f(x) = a + bx + cx^2
your procedure must compute and returns the three functions:
f0(x) = 1
f1(x) = x
f2(x) = x^2
Assuming the independant variable is 'x', write the following procedure:
sto(1,i)
sto(x,i+1)
sto(x*x,i+2)
The contents of the variable 'i' and eventually the indepentant variable, may
be modified by your procedure. Assuming that an area pointer is defined at
adress 2, the regression could be started with the following command:
reg 2,4,3,x
For such example, you could obtain a similar result with 'reg 2,0,2'.
Previous_page: {reg1}
{plotr}
plotr
-----
This command is used to plot a serie of data points identified by an area
pointer. It is also used to plot the data points and the regression function
obtained by the last 'reg' command.
Syntax : plotr area_pointer
area_pointer the same area pointer as used with the last 'reg', or
an area pointer to the x,y data points. In this last
case, Area_Z must be null.
Related_topics: {Area_Pointer}, {reg}, {listr}
{listr}
listr
-----
This command is used to display the data points measured and calculated from
the last regression analysis.
Syntax : listr area_pointer
area_pointer the same area pointer as used in the last 'reg'
command.
Related_topics: {Area_Pointer}, {reg}, {plotr}
{savevar}
savevar
-------
This command is used to save the current variables contents to a file. In no
extension is specified, the file extension '.mem' is used.
Syntax : savevar "filename"
Related_topics: {loadvar}
{loadvar}
loadvar
-------
This command is used to load the variables contents from a file. If no
extension is specified, the file extension '.mem' is used. If the file size is
less that the current variables table size, the table size is reduced. If the
file size is greater than the current variables table size, the file loading is
aborted when the table is full. A warning message is displayed in both case.
Syntax : savevar "filename"
Related_topics: {savevar}
{mean}
mean
----
This function returns the mean value of a serie of numbers stored into the
variables table.
Syntax : mean(adress,size)
adress is the indirect memory adress of the first data point
of the serie.
size is the number of data points in the serie.
Related_topic: {sigma} {min} {max}
{min}
min
---
This function returns the minimum value of a serie of numbers stored into the
variables table.
Syntax : min(adress,size)
adress is the indirect memory adress of the first data point
of the serie.
size is the number of data points in the serie.
Related_topic: {sigma} {mean} {max}
{max}
max
---
This function returns the maximum value of a serie of numbers stored into the
variables table.
Syntax : max(adress,size)
adress is the indirect memory adress of the first data point
of the serie.
size is the number of data points in the serie.
Related_topic: {sigma} {min} {mean}
{sigma}
sigma
-----
This function returns the standard deviation value (or sigma) of a serie of
numbers stored into the variables table.
Syntax : sigma(adress,size)
adress is the indirect memory adress of the first data point
of the serie.
size is the number of data points in the serie.
Related_topic: {mean} {min} {max}
{cor}
cor
---
This command computes the correlation function of a serie of numbers. The
correlation function of two series x(i) and y(i), both having n data points, is
defined as:
cor(j) = Sum [ x(i) * y((i + j) modulo n) ]
Syntax : cor area_pointer
area_pointer a pointer to a structure of kind {Area_Pointer}.
Area_X, AreaY define where the two series of numbers are stored.
Area_Z defines where 'cor' may store the resulting function.
Area_Size is the number of points in the X and Y series.
Area_R is not used here.
{normal}
normal
------
The standard normal distribution (or gaussian, or 'bell-curve') is the most
frequently used statistic in applied probability.
Syntax : normal(value,mean,sigma)
Given a normal distribution having 'mean' and 'sigma' as statistical
parameters, the 'normal' function returns the probability that a
random variable is less or equal to 'value'.
Caution : the accuracy of this function is around 7.5e-8.
Related_topic: {inormal}
{inormal}
inormal
-------
The standard normal distribution (or gaussian, or 'bell-curve') is the most
frequently used statistic in applied probability.
Syntax : inormal(probability,mean,sigma)
'inormal' is the inverse of the 'normal' function.
Given a normal distribution having 'mean' and 'sigma' as statistical
parameters, the 'inormal' function returns the maximum value that a
random variable can reach with for a given 'probability'.
Caution : the accuracy of this function is around 4.5e-4.
In order to obtain a better accuracy, combining the
'normal' function with the 'solve' algorithm should be
prefered. The blackdraw is a longer computing time.
Related_topic: {normal}
{listk}
listk
-----
It is possible to define customazed functions keys F1 to F10 and their Shift,
Control and Alternate versions. This gives you up to 40 user defined keys.
The 'listk' command displays all assigned functions keys.
To modify the assignment, use the {MCKEY} utility. Please, refer to this topic
for more details.
{mckey}
MCKEY.EXE
---------
This utility can be used to create a user keys definition file from an ASCII
text file that contains the key strings to assignate.
To create your own user keys definition file, write a text file using any
editor where you enter each key definition using the following syntax:
Key_code,"string to assign",value
Each key you want to assign must be at the beginning of a new line.
Key code is a number 01, 02, 03, ... , 10 preceded by a prefix: F,S,C,A.
The prefix means: F=normal, S=shift, C=Ctrl, A=Alt.
String to assign is the text of the string to assign to the key Key_code.
Value, if not zero, means that a 'Return' is added to the string.
Example: To assign the function 'help' to the key 'F1', with immediate
execution, give the following line:
F01,"help",1
To assign the command quit to Alt-F10, but the user as to strike the
return him self, add the following line to the file:
A10,"quit",0
More: {MCKEY1}
{MCKEY1}
When the file is filled as you want, run the MCKEY utility. On the command
line, give the name of your Source File.
Example: Let suppose your description file is "mykey.txt", give the following
dos command:
mckey mykey.txt
Caution: 1) mckey creates allways a definition file 'mcalc.key'. Your
original mcalc.key file will be overwritten. Keep allways a copy
in a safety place before running mckey.
2) Mcalc only load the new definition file when you start it. If
you modify it from a mcalc shell session, the new definition
file will not be used. Quit Mcalc and restart it.
3) If later, you want to modify your definition, just modify your
source file and recompile it with mckey.
Warning: The 'mckey.exe' utility and the source of the original keys
definition file 'mckey.def' are only supplied with the registered
version of Mcalc.
{read_}
read_
-----
This command is used to read a text structured file that contains columns of
numbers. The data are stored into memory and an area_pointer is initialized and
returned. When the data are in memory, they are ready to perform numerical
analysis via the interpol or reg commands.
Syntax: read_ "filename[.ext]",first_lin,nb_lin,x_col,y_col[options]
filename the name of the text file to read (if no extension is
supplied, Mcalc append the '.txt' extension.
first_lin the first line you want to read.
nb_lin the number of lines to read (= the number of points to
store in memory)
x_col the number of the data column for x values.
y_col the number of the data column for y values.
[options] ,basis,area_pointer
basis the starting memory adress where the data will be stored.
area_pointer the starting adress where the area pointer will be created.
Related_topics: {reg}, {interpol}, {plotr}, {area_pointer}
{interpol}
interpol & interpol_
--------------------
The 'interpol' command works on a serie of data points table located using an
area_pointer. It returns an interpolated value of y, for a given value of x.
Syntax : interpol area_pointer,x
area_pointer is the adress of a structure of type {area_pointer}
Area_X the adress of the x values table
Area_Y the adress of the y values table
Area_Size the number of points in the x,y tables
Area_Z & Area_R are not used and ignored.
x the x value you want the coresponding interpolated y
value.
Remarks: 1) 'interpol' use a lagrange polynome. The order (in the
range 1-9) is defined via the 'setup' command.
2) 'interpol_' works like 'interpol' but performs a third
order spline interpolation.
3) the (x,y) points don't need to be equally spaced, but
the x values must be sorted in increasing values.
{interpol_}
interpol_
---------
Please, refer at {interpol} topic.
{integral}
integral
--------
This command is used to compute the definite integral of a function or equation
described as a procedure. The procedure must first be loaded into the editor
memory. It must take one value from a given independant variable, and returns a
value into another dependant variable.
Syntax : integral input_var, output_var, from, to, accuracy
input_var the procedure input variable name
output_var the procedure output variable name
from the first limit of integration
to the second limit of integration
accuracy the absolute error allowed when computing the
integral.
The 'integral' command uses the Romberg integration principle. the 'accuracy'
parameter must be small in respect to the expected answer, but not too small.
Practically, accuracy could not be smaller that the expected answer divided by
a factor 1e12.
{last}
last
----
This function does not take any argument, and returns the value of the latest
computed answer in evaluation mode. It also returns the value of the latest
results for some commands in procedure mode.
After a {clear} command, it returns the highest possible indirect index value.
{Utilities}
Utilities.
----------
The registered version of Mcalc is supplied with the following utilies:
{MAC} The macro editor/compiler driver.
{MCMAC} The macro compiler.
{MCKEY} The user keys definition compiler.
{MAKEUNIT} Utility to modify the original physical units database.
{NOTEPAD} A small windowing editor to write procedure and macro.
{ASSISTANT} A window and menu interfaced assistant add-in that
gives you most Mcalc features at the fingers.
{Macro}
Macro.
------
The 'macro' command starts the execution of a keyboard automated macro file.
The file extension '.mac' is automatically supplied.
Syntax : macro "filename"
macro
To start a macro execution, use the first syntaxe. "filename" is the name of a
".mac" file, already compiled using MCMAC or MAC utilities.
The second syntax may be used when a macro is running to abort itself.
To abort a running macro from the keyboard, strike the Ctrl_End key.
More: {Macro1}
Related_topics: {MCMAC}, {MAC}
{Macro1}
The macro language.
-------------------
A macro is a sequence of keystrokes, stored previously into a file, and
executed automatically by Mcalc. Before using a macro, you must performs the
following steps:
1) Write a macro source file.
2) Compile the macro into an executable file.
3) Run the macro using the 'macro' command.
A macro source file is any ascii text file having the extension '.mcs'.
A macro source file follows the following syntax rules:
- a line beginning with ';' is skipped. It is a comment.
- a line beginning with '#' is a command line interpreted by the compiler.
- the following characters are ignored: TAB, CARRIAGE RETURN, LINE FEED
- the character '~' is interpreted as the ENTER or RETURN key.
- anything after '<' is considered as an escape sequence to describe a
particular key.
More: {Macro2}
{Macro2}
The macro escape sequences.
---------------------------
The following strings are recognized as 'escape sequences'. Instead of
submitting all characters as keystrokes, the sequence is replaced by one unique
equivalent key:
<up> <down> <lft> <rgt> <home> <end> <pgup> <pgdn> <enter>
<ctrlhome> <ctrlend> <ctrlpgup> <ctrlpgdn> <ctrllft> <ctrlrgt>
<bks> <del> <ins> <tab> <shifttab> <esc>
<f1> .... <f10>
<shiftf1> ... <shiftf10>
<ctrlf1> ... <ctrlf10>
<altf1> ... <altf10>
To send a '<' character, use the <<> escape sequence.
More: {Macro3}
{Macro3}
The macro compiler commands.
----------------------------
Any line beginning with '#' is a command that has a special meaning for the
compiler. The following commands are available:
#Wvalue Wait 'value' secondes before continuing the macro
execution.
#K Wait until a key is pressed on the keyboard. The striked
key is not passed to Mcalc.
#Fa,b Begin of a for-next loop.
Up to 10 loops may be imbricated. A loop is identified by a
digit a (in the range 0 to 9). b is the number of loops to
run (in the range 1 to 32000).
#Na Next instruction to finish a loop. 'a' is the same
identifier and must match this the #Fa identifier.
#S Suspend the current macro until CTRL_PGDN is striked. Mcalc
may be normally used during the macro is suspended.
#Tll,cc,String Write String on the screen at line ll, column cc. The upper
left corner is at coordinates (1,1). Any underscore
character is translated to a SPACE. If ll=-1 or cc=-1, the
text is displayed at the next line, same column as the
previous #T command.
More : {Macro4}
{Macro4}
Example of two imbricated loops:
#F0,10
code...
#F1,5
code...
#N1
#N0
{MAC}
MAC
---
'MAC' is the macro editor/compiler driver. You can execute it from the dos
prompt, or from Mcalc using the 'editm' command.
This utility is usefull to call the editor you want to use to write a macro
source file, to call the MCMAC macro compiler, or to force recompiling all
modified macros since the last compilation.
{MCMAC}
MCMAC
-----
'MCMAC' is the macro compiler. You can use it directly from the Dos prompt, or
from the 'MAC' driver.
Standalone syntax : MCMAC filename
A source file with extension '.mcs' is searched for. If correct, it is compiled
and a run macro file is created having extension '.mac'.
{NOTEPAD}
NOTEPAD
-------
'NOTEPAD' is a small multiple windows editor that you can use to write your
procedures and macros.
Using the Alt_M toggle key, you can edit as with a normal editor, or use
Notepad to write directly macro escape sequences.
{ASSISTANT}
ASSISTANT
---------
'ASSISTANT' is a Mcalc add-in. This utility combines procedure and macro powers
to integrate a windowed and menu interface with Mcalc calculation power. The
result is Mcalc possibilities, driven by a menuing system.
To invoke ASSISTANT, begin a new command line by any of the following keys:
/ * or <
Remark: ASSISTANT is only supplied with the registered version of Mcalc.
{editm}
editm
-----
This command is used to invoke the {MAC} utility.
Syntax : editm
{task}
task
----
This command is used to invoke a user written task or process. Before the task
is invoked, the variables are saved under the file 'mcalc.mem'. After the
process, the variables are restored from the same file.
Syntax : task "taskfile"
taskfile is the name of the task to run. It will be truncated
to 12 characters. If no file extension is specified,
Mcalc will try 'com', 'exe' and finally 'bat' files.
The task file can be written in any langage and must
be in the current directory or in the current path.
{scale}
scale
-----
This command can be used in conjonction with the {plot} and {graph} commands.
In both case, it defines the scale types that will be used in subsequent
graphical screens.
Syntax : scale axis_x , axis_y , remapflag
axis_x,axis_y this defines the scale function applied to the
corresponding axis. Possible arguments are: N (normal
linear scale), R (square root),L (logarithmic) or G
(gaussian curve : normal(x,0,1)
remapflag this flag defines if the axis graduations are done by
dividing the range into 5 logical parts (N = normal),
or by dividing the range into 5 physically equal parts
(R = remap).
Caution : The R axis needs positive values, while the L axis
needs strictly positive values.
G axis disables the Remap flag.
When Mcalc is started, the 'scale n,n,n' options are always used by default.
{remote}
remote
------
The 'remote' command is used in the extended slave processor mode of Mcalc to
get the status of the remote communication status word. It current status is
returned into the 'last' register. Possible returned values are:
-3 The remote communication file 'mcalcrem.sys' was not found, or
did not exist.
-2 The remote communication file is locked. A master process is
currently writting to it.
>=0 The command or status word to use.
This command only works correctly if the following conditions are satisfied:
1. MSDOS version 3.0 or higher is used.
2. The 'share.exe' dos extension is loaded.
3. Mcalc is executed in a MSDOS session under Windows 3.1 or higher
running in 386 enhanced mode.
Related command: {lock}
{lock}
lock
----
The 'lock' command is used in the extended master processor mode of Mcalc to
send the remote communication command word to another session of Mcalc running
in slave mode.
Syntax: lock expression
expression is an integer value that have the following meaning:
-1 = lock the communication file. (Prevent any slave process of reading
the file, during any file modification.)
-2 = unlock the communication file.
a value in the range 0 - 32000 stored to the communication file.
This command only works correctly if the following conditions are satisfied:
1. MSDOS version 3.0 or higher is used.
2. The 'share.exe' dos extension is loaded.
3. Mcalc is executed in a MSDOS session under Windows 3.1 or higher
running in 386 enhanced mode.
Related command: {lock}
{float}
The floating point exception handler.
-------------------------------------
The floating point exception handler is a special task, within Mcalc, that
handles and controls how the floating point math package will react in special
situations. Mcalc performs all computations using a double precision floating
point system. If a mathematical coprocessor (8087, 80287, 80387 or 80486DX) is
found, Mcalc will use it. Else, it will emulate the processor via its own
software. In both case, the floating point package will be loaded with default
parameters. These parameters are called the floating-point control word.
The 'float' function gets and sets the floating-point control word, which
allows the program to change the precision, rounding, and infinity modes in the
floating-point math package. You can mask or unmask floating-point exceptions
by using the 'float' function.
Syntax : float 0
float mask,control_set
mask defines which control set must be changed.
control_set defines the new control set to be used.
More: {float1}
{float1}
If the first syntax is used, Mcalc just displays the current control word. This
word is the ored combination of all control_sets selected. The control word is
displayed in hexadecimal notation.
If the second syntax is used, you can modify one of the following kind of sets:
floating exceptions, infinity mode, precision and rounding. The (default) means
that this parameter is set when you start Mcalc.
mask control_set or
Enable floating point exception for ....
1 1 #h0001 Invalid operation (default)
2 #h0002 Denormal number
4 #h0004 Divide by zero (default)
8 #h0008 Overflow (default)
16 #h0010 Underflow
32 #h0020 Inexact (precision)
Behave infinity mode as ....
2 4096 #h1000 Affine (+inf != -inf) (default)
0 #h0000 Projective (+inf = -inf)
Next: {float2}, Previous: {float}
{float2}
Select rounding method as ....
3 0 #h0000 Near (default)
1024 #h0400 Down
2048 #h0800 Up
3072 #h0c00 Chop
Computation precision ....
4 0 #h0000 24 bits
512 #h0200 53 bits
768 #h0300 64 bits (default)
Enable floating points exceptions but trap them (don't cancel evaluation)
5 Same as for mask=1 but invalid,divide by 0 and overflow
are always enabled.
Reset to default settings:
6 0 #h0000 Exceptions: invalid operation
divide by 0
overflow
Infinity : affine
Rounding : near
Precision : 64 bits
Next: {float3}, Previous: {float1}
{float3}
Enabling exceptions means that if a specific exception occurs, Mcalc
interrupts the normal expression evaluation and reset the floating point
machine (coprocessor or emulator).
If any mask other than 5 have been selected, the parser execution is
cancelled and a floating point error message is displayed. This is the
default behaviour of Mcalc.
If mask=5 have been selected, Mcalc resumes the execution where it was
interrupted. In this case, the exception has been trapped and the current
procedure or macro continues. The advantage is that some procedure can
continue (for example plotting a function curve), self if one data point
could not be correctly evaluated. The inconvenience is that Mcalc
evaluation can lead to incorrect computation, WITHOUT ANY ERROR MESSAGE.
In this mode, when you quit Mcalc, the total number of trapped exceptions
(errors that have not been displayed) is indicated as a warning.
Next: {float4}, Previous: {float2}
{float4}
The following exceptions can be detected:
invalid operation
An invalid operation occured. This usually involves operating on a
NAN (Not A Number) or an infinity.
denormal number
A very small floating-point number was generated, which may no longer
be valid due to loss of significance. Denormals are by default
trapped and operated on.
division by zero
An attempt was made to divide by zero.
overflow
An overflow occured in a floating-point operation.
underflow
An underflow occured in a floating-point operation. Underflows are by
default trapped and the underflowing value replaced by 0.0.
Next: {float5}, Previous: {float3}
{float5}
inexact
Loss of precision occured in a floating-point operation. By default,
it is trapped, since almost any floating-point operation can cause
loss of precision.
unemulated
An attempt was made to execute an 8087/80287 instruction that is
invalid or not supported by the emulator. This should normally never
occurs and means a bug in the compiler.
negative square root
the operand in a square root operation is negative. This should
normally never occurs and means a bug in the compiler.
stack overflow, underflow
a floating-point expression caused a coprocessor or emulator stack
overflow/underflow.
explicit exception
a software floating point exception signal was send. This should
normally never occurs and could be a Mcalc bug.
Previous: {float4}
{abs}
{acos}
{acosh}
{and}
{asin}
{asinh}
{atan}
{atanh}
{cos}
{cosh}
{exp}
{exp2}
{exp10}
{fact}
{finput_}
{frac}
{from}
{help}
{int}
{j0}
{j1}
{jn}
{y0}
{y1}
{yn}
{ln}
{log}
{log2}
{log10}
{next}
{not}
{or}
{pi}
{pwr}
{return}
{rnd}
{sin}
{sinc}
{sinh}
{sqr}
{sqrt}
{step}
{tan}
{tanh}
{then}
{to}
{twopi}
{xor}
{modulo}